﻿using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;

namespace Scheduler.Model;
public class BaseEntity : RootEntityTkey<long>
{
    /// <summary>
    /// 中立字段，某些表可使用某些表不使用   <br/>
    /// 逻辑上的删除，非物理删除  <br/>
    /// 例如：单据删除并非直接删除
    /// </summary>
    [Comment("逻辑删除")]
    [Required]
    public bool IsDeleted { get; set; }=false;

    /// <summary>
    /// 创建Id
    /// </summary>
    [Comment("创建者Id")]
    [Required]
    public long? CreateId { get; set; }

    /// <summary>
    /// 创建者
    /// </summary>
    [Comment("创建者")]
    [StringLength(20)]
    [Required]
    public string? CreateBy { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Comment("创建时间")]
    [Required]
    public DateTime CreateTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 修改Id
    /// </summary>
    [Comment("修改Id")]
    public long? ModifyId { get; set; }

    /// <summary>
    /// 更新者
    /// </summary>
    [Comment("更新者")]
    [StringLength(20)]
    public string? ModifyBy { get; set; }

    /// <summary>
    /// 修改日期
    /// </summary>
    [Comment("修改日期")]
    public DateTime? ModifyTime { get; set; } = DateTime.Now;
}